package com.cherry.mybatis.dao;

import com.cherry.mybatis.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface EmpAnnoDao {

    @Insert("insert into emp(name,gender,salary,join_date,dept_id) values(#{name},#{gender},#{salary},#{join_date},#{dept_id})")
    int add(Emp emp);

    @Update("update emp set name = #{name} where id = #{id}")
    int update(Emp emp);

    @Delete("delete from emp where id = #{id}")
    int delete(Long id);


    @Select("select * from emp")
    List<Emp> findAll();



}
